/* ----------------------------------------------------------------------
*
* Copyright (C) 2025 XiaoFei. All rights reserved.
*
* $file:		XiaoZhi_Resis.h
* $Date:        26-January-2025
* $Revision: 	V1
* $Project: 	XiaoFei BSP Library
* $Taobao:      https://item.taobao.com/item.htm?abbucket=17&id=795419543026
*
* -------------------------------------------------------------------- */

#ifndef __XiaoZhi_Resis_H
#define __XiaoZhi_Resis_H

#define Resis_Use_ADC2
#define Resis_RCC_SIG					RCC_APB2Periph_GPIOA
#define Resis_GPIO_SIG				    GPIOA
#define Resis_PIN_SIG					GPIO_Pin_0
#define Resis_ADC_Channel			    ADC_Channel_0

/* 
* @function: 	Resis_Init
*/
void Resis_Init(void);

/* 
* @function: 	Resis_GetValue
* @return:		The ADC value from resistance. This value will be mapped from 0 to 3.3 volts to 0 to 4096.
*/
unsigned int Resis_GetValue(void);

/* 
* @function: 	Resis_GetVoltage
* @return:		The Voltage value from resistance. This value need to be limited to 0 to 3.3 volts.
*/
float Resis_GetVoltage(void);

#endif


